class Queue {
  items = {};
  lowCount = 0;
  count = 0;
  enqueue(item) {
    this.items[this.count] = item;
    this.count++;
  }
  dequeue() {
    if (this.isEmpty()) {
      return;
    }
    const dequeueItem = this.items[this.lowCount];
    delete this.items[this.lowCount];
    this.lowCount++;
    return dequeueItem;
  }
  front() {
    return this.items[this.lowCount];
  }
  isEmpty() {
    return this.size() === 0;
  }
  size() {
    return this.count - this.lowCount;
  }
  clear() {
    this.items = {};
    this.lowCount = 0;
    this.count = 0;
  }
}
const queue = new Queue();
console.log(queue.isEmpty());
queue.enqueue('小灿1');
queue.enqueue('小灿2');
queue.enqueue('小灿3');
console.log(queue);
console.log(queue.size());
console.log(queue.dequeue());
console.log(queue);
console.log(queue.dequeue());
console.log(queue);
queue.dequeue();

queue.enqueue('小灿4');
console.log(queue);
